import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: '登录页面',
      component: () => import('@/views/LoginView.vue')
    },
    {
      path: '/register',
      name: '注册页面',
      component: () => import('@/views/Register.vue')
    },
    {
      path: '/',
      name: 'Layout',
      // redirect: '/home',
      component: () => import('@/views/Layout.vue'),
      children: [
        {
          path: 'list',
          name: '申请清单',
          component: () => import('../views/ListView.vue')
        },
        {
          path: 'invoiced',
          name: '待开票列表',
          component: () => import('../views/invoiced.vue')
        },
        {
          path: 'examine',
          name: '待审核列表',
          component: () => import('../views/Examine.vue')
        },
        {
          path: 'dryBox',
          name: '开票列表（干箱）',
          component: () => import('../views/DryBoxView.vue')
        },
        {
          path: 'parts',
          name: '开票列表（零部件）',
          component: () => import('../views/PartsView.vue')
        },
        {
          path: 'domesticSales',
          name: '开票列表（内销）',
          component: () => import('../views/DomesticSalesView.vue')
        },
        {
          path: 'time',
          name: '时间统计表',
          component: () => import('../views/Time.vue')
        },
        {
          path: 'customer',
          name: '客户管理',
          component: () => import('../views/CustomerView.vue')
        },
        {
          path: 'user',
          name: '用户管理',
          component: () => import('../views/UserView.vue')
        },
      ]
    },
    {
      path: '/newDomestic',
      name: '内销新建',
      component: () => import('../views/newDomestic.vue')
    },
    {
      path: '/Export',
      name: '外销新建',
      component: () => import('../views/Export.vue')
    },
    {
      path: '/InvoiceChange',
      name: '票据新建',
      component: () => import('../views/InvoiceChange.vue')
    },
    {
      path: '/InvoiceDoubleChange',
      name: '票据双倍新建',
      component: () => import('../views/InvoiceDoubleChange.vue')
    },
    {
      path: '/InvoiceNewChange',
      name: '票据新建（新）',
      component: () => import('../views/InvoiceNewChange.vue')
    },
    {
      path: '/printInvoice',
      name: '票据打印1',
      component: () => import('../views/printInvoice.vue')
    },
    {
      path: '/dryBoxPrintInvoice',
      name: '票据打印2',
      component: () => import('../views/dryBoxPrintInvoice.vue')
    },
    {
      path: '/printDoubleInvoice',
      name: '票据打印1双倍',
      component: () => import('../views/printDoubleInvoice.vue')
    },
    {
      path: '/dryBoxPrintDoubleInvoice',
      name: '票据打印2双倍',
      component: () => import('../views/dryBoxPrintDoubleInvoice.vue')
    },
  ]
})

export default router
